package main

import "fmt"

// 只写
func in(channel chan<- int) {
	channel <- 1
	channel <- 2

}

// 只读
func out(channel <-chan int) {
	fmt.Println(<-channel)
	fmt.Println(<-channel)
}

func main() {
	var channel chan int = make(chan int, 3)
	var rchannel chan<- int = channel
	var wchannel <-chan int = channel
	in(rchannel)
	out(wchannel)
}
